<%@ page import="com.bjpowernode.user.User" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" +
            request.getServerPort() + request.getContextPath() + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="<%=basePath%>">
    <%
        String username = (String) session.getAttribute("username");
    %>
    <script type="text/javascript" src="jQuery/jquery-3.5.1.js"></script>
    <script type="text/javascript">
        function gz(id){
            $.ajax({
                url:"follow/add.do",
                data:{
                    username:"<%=username%>",
                    gzid:id
                },
                success:function(response){
                    alert(response);
                }
            })
        }
    </script>
</head>
<body>
<%
    List<User> userList = (List<User>) request.getAttribute("userList");
    if (userList.size() == 0){
%>
<center>
    <div style="background: white;width: 850px;height: 50px;line-height: 50px;margin-top: 10px">
        您还没有任何粉丝，快去发博涨粉吧！
    </div>
</center>
<%
    }
    Iterator<User> it = userList.iterator();
    while(it.hasNext()){
        User user = it.next();
%>
<center>
    <div id="user" align="left" style="background: white;width: 850px;height: 80px">
        <table style="margin-left: 100px;height: 70px">
            <tr>
                <td style="cursor: pointer"><%=user.getUsername()%></td>
                <td>
                    <div style="cursor: pointer;width: 100px;height: 30px;margin-top: 2px;margin-left: 10px;line-height: 30px">
                        <a href="user/findXinxi.do?name=<%=user.getUsername()%>" target="_top"><font style="color: rgb(248,93,0);margin-left: 10px"><b>他的主页</b></font></a>
                    </div>
                </td>
            </tr>
        </table>
        <hr>
    </div>
</center>
<%--<table style="border-bottom: 1px solid rgba(0,0,0,0.35)">
    <tr>
        <td colspan="2"><%=user.getUsername()%></td>
    </tr>
    <tr>
        <td><a href="dynamic/selectUser.do?name=<%=user.getUsername()%>">他的微博</a></td>
        <td style="cursor: pointer" onclick="gz(<%=user.getId()%>)">关注</td>
    </tr>
</table>--%>
<%
    }
%>
</body>
</html>
